package stack_queue.leetcode.queue;

import java.util.Arrays;
import java.util.PriorityQueue;

/**
 * @author shkstart
 * @create 2022-10-11-15:17
 */
public class QueueTest {
    public static void main(String[] args) {

        int[]arr = {3,5,2,1,7,6,9,8};
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        for(int i  : arr){
            queue.offer(i);
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i]= queue.poll();
        }
        System.out.println(Arrays.toString(arr));



    }
}
